
#include "headers.h"
#include "database.h"

using namespace database;

#define MODELID_SYNDROME       170
#define DESCRIPTIONID_SYNDROME 333
#define COST_SYNDROME          50.0f
#define PROPS_SYNDROME         0.25f, 0.125f

#define MODELID_TENSOR       365
#define DESCRIPTIONID_TENSOR 366 
#define COST_TENSOR          250.0f
#define PROPS_TENSOR         0.33f, 0.25f

#define MODELID_SHOOTER       367
#define DESCRIPTIONID_SHOOTER 368
#define COST_SHOOTER          250.0f
#define PROPS_SHOOTER         0.5f, 0.5f

static Helmet helmets[] =
{
    /* 000 */ { COST_SYNDROME, PROPS_SYNDROME, 0, MODELID_SYNDROME, DESCRIPTIONID_SYNDROME, CLID_DARK_BLUE, MFRID_D3, 0 },
    /* 001 */ { COST_SYNDROME, PROPS_SYNDROME, 0, MODELID_SYNDROME, DESCRIPTIONID_SYNDROME, CLID_PURPLE, MFRID_D3, 1 },
    /* 002 */ { COST_SYNDROME, PROPS_SYNDROME, 0, MODELID_SYNDROME, DESCRIPTIONID_SYNDROME, CLID_KHAKI, MFRID_D3, 2 }, 
    /* 003 */ { COST_SYNDROME, PROPS_SYNDROME, 0, MODELID_SYNDROME, DESCRIPTIONID_SYNDROME, CLID_LILAC, MFRID_D3, 3 }, 
    /* 004 */ { COST_SYNDROME, PROPS_SYNDROME, 0, MODELID_SYNDROME, DESCRIPTIONID_SYNDROME, CLID_YELLOW, MFRID_D3, 4 }, 
    /* 005 */ { COST_SYNDROME, PROPS_SYNDROME, 0, MODELID_SYNDROME, DESCRIPTIONID_SYNDROME, CLID_MAGENTA, MFRID_D3, 5 }, 
    /* 006 */ { COST_SYNDROME, PROPS_SYNDROME, 0, MODELID_SYNDROME, DESCRIPTIONID_SYNDROME, CLID_LIGHT_BLUE, MFRID_D3, 6 }, 
    /* 007 */ { COST_SYNDROME, PROPS_SYNDROME, 0, MODELID_SYNDROME, DESCRIPTIONID_SYNDROME, CLID_LIGHT_GREEN, MFRID_D3, 7 }, 
    /* 008 */ { COST_SYNDROME, PROPS_SYNDROME, 0, MODELID_SYNDROME, DESCRIPTIONID_SYNDROME, CLID_ORANGE, MFRID_D3, 8 },
    /* 009 */ { COST_SYNDROME, PROPS_SYNDROME, 0, MODELID_SYNDROME, DESCRIPTIONID_SYNDROME, CLID_WHITE, MFRID_D3, 9 }, 
    /* 010 */ { COST_SYNDROME, PROPS_SYNDROME, 0, MODELID_SYNDROME, DESCRIPTIONID_SYNDROME, CLID_CRIMSON, MFRID_D3, 11 }, 
    /* 011 */ { COST_SYNDROME, PROPS_SYNDROME, 0, MODELID_SYNDROME, DESCRIPTIONID_SYNDROME, CLID_LIGHT_VIOLET, MFRID_D3, 12 }, 
    /* 012 */ { COST_SYNDROME, PROPS_SYNDROME, 0, MODELID_SYNDROME, DESCRIPTIONID_SYNDROME, CLID_VIOLET, MFRID_D3, 13 }, 
    /* 013 */ { COST_SYNDROME, PROPS_SYNDROME, 0, MODELID_SYNDROME, DESCRIPTIONID_SYNDROME, CLID_DARK_GREEN, MFRID_D3, 15 },
    /* 014 */ { COST_TENSOR, PROPS_TENSOR, 1, MODELID_TENSOR, DESCRIPTIONID_TENSOR, CLID_WHITE, MFRID_D3, 18 },
    /* 015 */ { COST_TENSOR, PROPS_TENSOR, 1, MODELID_TENSOR, DESCRIPTIONID_TENSOR, CLID_LIGHT_BLUE, MFRID_D3, 19 },
    /* 016 */ { COST_TENSOR, PROPS_TENSOR, 1, MODELID_TENSOR, DESCRIPTIONID_TENSOR, CLID_DARK_BLUE, MFRID_D3, 20 },
    /* 017 */ { COST_TENSOR, PROPS_TENSOR, 1, MODELID_TENSOR, DESCRIPTIONID_TENSOR, CLID_VIOLET, MFRID_D3, 21 },
    /* 018 */ { COST_TENSOR, PROPS_TENSOR, 1, MODELID_TENSOR, DESCRIPTIONID_TENSOR, CLID_LIGHT_VIOLET, MFRID_D3, 22 },
    /* 019 */ { COST_TENSOR, PROPS_TENSOR, 1, MODELID_TENSOR, DESCRIPTIONID_TENSOR, CLID_MAGENTA, MFRID_D3, 23 },
    /* 020 */ { COST_TENSOR, PROPS_TENSOR, 1, MODELID_TENSOR, DESCRIPTIONID_TENSOR, CLID_DARK_GREEN, MFRID_D3, 24 },
    /* 021 */ { COST_TENSOR, PROPS_TENSOR, 1, MODELID_TENSOR, DESCRIPTIONID_TENSOR, CLID_LIGHT_GREEN, MFRID_D3, 25 },
    /* 022 */ { COST_TENSOR, PROPS_TENSOR, 1, MODELID_TENSOR, DESCRIPTIONID_TENSOR, CLID_YELLOW, MFRID_D3, 26 },
    /* 023 */ { COST_SHOOTER, PROPS_SHOOTER, 2, MODELID_SHOOTER, DESCRIPTIONID_SHOOTER, CLID_WHITE, MFRID_D3, 27 },
    /* 024 */ { COST_SHOOTER, PROPS_SHOOTER, 2, MODELID_SHOOTER, DESCRIPTIONID_SHOOTER, CLID_DARK_BLUE, MFRID_D3, 28 },
    /* 025 */ { COST_SHOOTER, PROPS_SHOOTER, 2, MODELID_SHOOTER, DESCRIPTIONID_SHOOTER, CLID_LIGHT_BLUE, MFRID_D3, 29 },
    /* 026 */ { COST_SHOOTER, PROPS_SHOOTER, 2, MODELID_SHOOTER, DESCRIPTIONID_SHOOTER, CLID_VIOLET, MFRID_D3, 30 },
    /* 027 */ { COST_SHOOTER, PROPS_SHOOTER, 2, MODELID_SHOOTER, DESCRIPTIONID_SHOOTER, CLID_LIGHT_VIOLET, MFRID_D3, 31 },
    /* 028 */ { COST_SHOOTER, PROPS_SHOOTER, 2, MODELID_SHOOTER, DESCRIPTIONID_SHOOTER, CLID_MAGENTA, MFRID_D3, 32 },
    /* 029 */ { COST_SHOOTER, PROPS_SHOOTER, 2, MODELID_SHOOTER, DESCRIPTIONID_SHOOTER, CLID_YELLOW, MFRID_D3, 33 },
    /* 030 */ { COST_SHOOTER, PROPS_SHOOTER, 2, MODELID_SHOOTER, DESCRIPTIONID_SHOOTER, CLID_LIGHT_GREEN, MFRID_D3, 34 },
    /* 031 */ { COST_SHOOTER, PROPS_SHOOTER, 2, MODELID_SHOOTER, DESCRIPTIONID_SHOOTER, CLID_DARK_GREEN, MFRID_D3, 35 },
    /* 032 */ { COST_SYNDROME, PROPS_SYNDROME, 0, MODELID_SYNDROME, DESCRIPTIONID_SYNDROME, CLID_BLACK, MFRID_D3, 64 },
    { 0.0f, 0, 0, 0, 0, 0 },
};

unsigned int Helmet::getNumRecords(void)
{
    unsigned int result = 0;
    unsigned int i = 0;
    while( helmets[i].nameId != 0 ) i++, result++;
    return result;
}

Helmet* Helmet::getRecord(unsigned int id)
{
    assert( id >= 0 && id < getNumRecords() );
    return helmets + id;
}